
***************BEGIN COMPUTING MOMENTS***************
use "$temp/nlsy_moment_data", clear
drop if hgc_final>20
gen coll_final = (hgc_final>=16)


set seed 1234
qui{
forval i = 1/1000{
	preserve
	bsample
	su coll_final [fw=weight_17]
	local m1 = `r(mean)'

	su coll_final [fw=weight_17] if parent_inc_quart == 1
	local m2 = `r(mean)'
	su coll_final [fw=weight_17] if parent_inc_quart == 2
	local m3 = `r(mean)'
	su coll_final [fw=weight_17] if parent_inc_quart == 3
	local m4 = `r(mean)'
	su coll_final [fw=weight_17] if parent_inc_quart == 4
	local m5 = `r(mean)'

	su coll_final [fw=weight_17] if ability == 1
	local m6 = `r(mean)'
	su coll_final [fw=weight_17] if ability == 2
	local m7 = `r(mean)'
	su coll_final [fw=weight_17] if ability == 3
	local m8 = `r(mean)'
	su coll_final [fw=weight_17] if ability == 4
	local m9 = `r(mean)'
	su coll_final [fw=weight_17] if ability == 5
	local m10 = `r(mean)'

	su coll_final [fw=weight_17] if !parcoll
	local m11 = `r(mean)'
	su coll_final [fw=weight_17] if parcoll
	local m12 = `r(mean)'
	
	clear
	set obs 12
	gen moment = .
	forval j = 1/12{
		replace moment = `m`j'' in `j'
	}
	xpose, clear
	save "$temp/boot/nlsy_boot_r2_`i'", replace
	restore
}
}

clear
forval i = 1/1000{
	append using "$temp/boot/nlsy_boot_r2_`i'"
}
su*
export delimited "$dir/Model/boot/nlsy_r2_boot_sample.csv", replace novarn

